#ifndef __A6GSM_H__
#define __A6GSM_H__

#include <Arduino.h>

#define USE_SOFTWARE_SERIAL //Comment this line for use  HardwareSerial

#if defined(USE_SOFTWARE_SERIAL)
#include <SoftwareSerial.h>
#endif

class A6GSM
{
 private:
  void flushSerial();
#if defined(USE_SOFTWARE_SERIAL)
  SoftwareSerial *GSM_Serial;
#else
   HardwareSerial *GSM_Serial;
#endif
 public:
	#define OK 1
	#define NOTOK 2
	#define TIMEOUT 3
	char end_c[2] = {0x1a, '\0'};
	
    A6GSM(){};//Empty contructor
#if defined(USE_SOFTWARE_SERIAL)
  A6GSM(SoftwareSerial &next, uint32_t baud);//Constructor
#else
  A6GSM(HardwareSerial &next, uint32_t baud);//Constructor
#endif
	void Reset(const int rst, int on_time, int off_time);
	void Call(String phone_no);
	void Send_SMS(String phone_no, String Data);
	String Read_SMS();
	bool A6begin();
	byte A6command(String command, String response1, String response2, int timeOut, int repetitions);
	byte A6waitFor(String response1, String response2, int timeOut);
	void request(String host, String Path, String data, String dev_ID);
	void network(String opt);
	void net_Init(const int rst, int on, int off, String opt);
	String A6read();
	String splitdata(String data, char separator, int index);
	String split_data(String inputString, String delimiter, String endChar);
};
#endif






